﻿#include "FITKLoadPowerSourcesFESubsys.h"
#include "FITKAcousticsAbstractSpectra.h"
#include "FITK_Kernel/FITKCore/FITKDataRepo.h"

namespace Acoustics
{
    FITKLoadPowerSourcesFESubsys::FITKLoadPowerSourcesFESubsys()
    {
        //构造
    }

    FITKLoadPowerSourcesFESubsys::~FITKLoadPowerSourcesFESubsys()
    {
        //析构
    }

    FITKAcousticsAbstractLoad::AcousticsLoadType FITKLoadPowerSourcesFESubsys::getAcousticsLoadType()
    {
        //获取载荷类型
        return FITKAcousticsAbstractLoad::AcousticsLoadType::PowerFESubsys;
    }

    bool FITKLoadPowerSourcesFESubsys::copy(FITKAbstractDataObject* obj)
    {
        //拷贝数据
        FITKLoadPowerSourcesFESubsys* oldObj = dynamic_cast<FITKLoadPowerSourcesFESubsys*>(obj);
        if (!oldObj) return false;
        _enabledState = oldObj->_enabledState;
        _notes = oldObj->_notes;
        _connectObjID = oldObj->_connectObjID;
        _spectraID = oldObj->_spectraID;
        this->Core::FITKAbstractNDataObject::copy(obj);
        return true;
    }

    void FITKLoadPowerSourcesFESubsys::setSpectraDataID(int spectraID)
    {
        //设置频谱ID
        _spectraID = spectraID;
    }

    int FITKLoadPowerSourcesFESubsys::getSpectraDataID()
    {
        //获取频谱ID
        return _spectraID;
    }

    FITKAcousticsAbstractSpectra* FITKLoadPowerSourcesFESubsys::getSpectraDataObj()
    {
        //获取频谱对象
        return FITKDATAREPO->getTDataByID<FITKAcousticsAbstractSpectra>(_spectraID);
    }
}